package fashionshop.bll;

import java.math.BigDecimal;
import java.sql.ResultSet;
import java.util.Vector;

import fashionshop.dal.ImportDetailDAL;
import fashionshop.dal.OrderDetailDAL;

public class ImportDetailBLL {
	
	private int productID;
	private int importID;
	private BigDecimal price;
	private int quantity;
	private BigDecimal sum;
	
	public ImportDetailBLL() {
	}
	
	public int getProductID() {
		return productID;
	}
	public void setProductID(int productID) {
		this.productID = productID;
	}
	public int getImportID() {
		return importID;
	}
	public void setImportID(int importID) {
		this.importID = importID;
	}
	public BigDecimal getPrice() {
		return price;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public BigDecimal getSum() {
		return sum;
	}

	public void setSum(BigDecimal sum) {
		this.sum = sum;
	}
	
	public Vector loadImportDetail(int importID) throws Exception {
		
		Vector inportDetailTableRecords = new Vector();
		ResultSet result = ImportDetailDAL.LoadByImportID(importID);
		while (result.next()){
			Vector record = new Vector();
			record.add(result.getString("ImportID"));
			record.add(result.getString("ProductID"));
            record.add(result.getString("Code"));
            record.add(result.getString("Name"));
            record.add(result.getInt("Quantity"));
//            record.add(result.getString("Price"));
//            record.add(result.getString("Sum"));
			
            inportDetailTableRecords.add(record);
		}
		return inportDetailTableRecords;
	}
}
